class TeamProject < ActiveRecord::Base  
  
  has_many :teamstories
  has_many :stake_holders
  before_destroy :ensure_not_referenced_by_any_stories
  
  def ensure_not_referenced_by_any_stories
    if teamstories.count.zero?
      return true
    else
      errors[:base] << "stories present"
      return false
    end
  end
  

end
